import org.junit.experimental.categories.Categories;
import org.mygreencart.entities.Product
import org.mygreencart.entities.ProductCategory

	class BootStrap {

    def init = { servletContext ->
		
		
		// Check whether the test data already exists.
/*
			def ProductCategory nutrientsAndAdditives = new ProductCategory (name: "Nutrients and Additives").save(failOnError: true)
			def ProductCategory lighting = new ProductCategory (name: "Lighting").save(failOnError: true)
			def ProductCategory ventilationFilters = new ProductCategory (name: "Ventilation and Filters").save(failOnError: true)
			def ProductCategory climate = new ProductCategory (name: "Climate control").save(failOnError: true)
			def ProductCategory irrigationHydroponics = new ProductCategory (name: "Irrigation & Hydroponics").save(failOnError: true)
			def ProductCategory growingMedia = new ProductCategory (name: "Growing Media").save(failOnError: true)
			def ProductCategory propagationCloning = new ProductCategory (name: "Propagation and Cloning").save(failOnError: true)
			def ProductCategory growTents = new ProductCategory (name: "Grow Tents").save(failOnError: true)
			def ProductCategory pots = new ProductCategory (name: "Pots").save(failOnError: true)
			def ProductCategory metersTesters = new ProductCategory (name: "Meters and Testers").save(failOnError: true)
			def ProductCategory pestMolds = new ProductCategory (name: "Pests and Molds").save(failOnError: true)
			def ProductCategory harvestingTrimming = new ProductCategory (name: "Harvesting and Trimming").save(failOnError: true)
			def ProductCategory accessories = new ProductCategory (name: "Accessories").save(failOnError: true)						
	
			
			new Product(name: "Product 1",size: 1.23,volume: 2.33, weight: 2.1 )
			.addToCategories(nutrientsAndAdditives)
			.save(failOnError: true)
	*/
    }
    def destroy = {
    }
}
